﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Elsa.Workflows.State;
using Newtonsoft.Json;

namespace T.FAS.Runtime.MF.Entity
{
    [DataContract]
    public class ElsaExecutionResult
    {
        /// <summary>流程执行状态（例如: Finished, Faulted, Cancelled）。</summary>
        [DataMember(Name = "status")]
        public string Status { get; init; } = default!;
        /// <summary>流程输出变量，Key=变量名，Value=变量值。</summary>
        [DataMember(Name = "output")]
        public object Output { get; init; }

        [DataMember(Name = "result")]
        public object Result { get; set; }

        //[DataMember(Name = "workflowState")]
        public WorkflowState WorkflowState { get; set; }
        [DataMember(Name = "input")]
        public object Inputs { get; init; }
        [DataMember(Name = "elapsed_time")]
        public double? ElapsedTime { get; set; }
        [DataMember(Name = "error")]
        public string Exception { get; set; }
        [DataMember(Name = "created_at")]
        public long CreateAt { get; set; }
        [DataMember(Name = "finished_at")]
        public long? FinishedAt { get; set; }

        [DataMember(Name = "instanceId")]
        public string InstanceID { get; set; }

    }
}
